﻿// Collapse and expand the blocks
$("div.block.collapsible > h3").click(function () {
    if ($(this).parent().hasClass("closed")) {
        $(this).next(".bcontent").slideDown("fast").parent().removeClass("closed");
    } else {
        $(this).next(".bcontent").slideUp("fast").parent().addClass("closed");
    }
});
if ($('textarea.content').length > 0) {
    $('textarea.content').ckeditor({
        height: '450px'
    });
}
$('.datefield').datetimepicker({
    ampm: true,
    dateFormat: 'dd/mm/yy',
    timeFormat: 'hh:mm tt'
});
if ($('.datefield').datetimepicker('getDate') == null) {
    $('.datefield').datetimepicker('setDate', (new Date()));
}
$('.submit').click(function () { $('.form').submit(); });